<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
// Routes

$app->post('/tidy', function (Request $request, Response $response) {
    $this->logger->info("tidy");
    $parsedBody = $request->getParsedBody();
    $result = $this->purifier->purify($parsedBody['data']);
    $response->getBody()->write($result);
    return $response;
});